import axios from "@/libs/api.request";

// ---------------------------------- 微信相关 ---------------------------------- 

// 获取微信openId
export const getOpenId = params => {
  return axios.request({
    url: "/carStation/api/users/getOpenId.do",
    data: params,
    method: "post"
  });
};

// 用户是否关注公众号
export const judgeIsFollow = params => {
  return axios.request({
    url: "/carStation/api/users/judgeIsFollow.do",
    data: params,
    method: "post"
  });
};




// ---------------------------------- 用户相关信息 ---------------------------------- 
// 注册用户信息
export const PostRegisterUsers = params => {
  return axios.request({
    url: "/carStation/api/users/registerUsers.do",
    data: params,
    method: "post"
  });
};

// 查询用户信息
export const PostCarUsers = params => {
  return axios.request({
    url: "/carStation/api/users/queryUsers.do",
    data: params,
    method: "post"
  });
};

// 更新用户信息
export const updateUsers = params => {
  return axios.request({
    url: "/carStation/api/users/updateUsers.do",
    data: params,
    method: "post"
  });
};

// ---------------------------------- 车辆管理 ---------------------------------- 

// 查询车辆信息
export const PostCarInfo = params => {
  return axios.request({
    url: "/carStation/api/cars/queryCars.do",
    data: params,
    method: "post"
  });
};


// 数据字典 
export const dataDir = params => {
  return axios.request({
    url: "/carStation/api/dataDir.do",
    data: params,
    method: "post"
  });
};

// 添加车辆信息
export const addCars = params => {
  return axios.request({
    url: "/carStation/api/cars/addCars.do",
    data: params,
    method: "post"
  });
};


// 修改车辆信息
export const updateCars = params => {
  return axios.request({
    url: "/carStation/api/cars/updateCars.do",
    data: params,
    method: "post"
  });
};

// 删除车辆信息
export const delCars = params => {
  return axios.request({
    url: "/carStation/api/cars/delCars.do",
    data: params,
    method: "post"
  });
};

// 行驶证识别
export const readCarInfo = params => {
  return axios.request({
    url: "/carStation/api/cars/readCarInfo.do",
    data: params,
    method: "post",
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};

// 上传文件 附件
export const getWxJsConfig = params => {
  return axios.request({
    url: "/carStation/app/common/sigleFileUpload.do",
    data: params,
    method: "post",
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};

// ---------------------------------- 车检数据 ---------------------------------- 

// 预约时间段查询
export const queryCarTime = params => {
  return axios.request({
    url: "/carStation/api/order/queryCarTime.do",
    data: params,
    method: "post"
  });
};

// 车检数据提交
export const createOrder = params => {
  return axios.request({
    url: "/carStation/api/order/createOrder.do",
    data: params,
    method: "post"
  });
};

// 车检数据查询
export const queryOrder = params => {
  return axios.request({
    url: "/carStation/api/order/queryOrder.do",
    data: params,
    method: "post"
  });
};

// 车检进度查询
export const queryOrderStep = params => {
  return axios.request({
    url: "/carStation/api/order/queryOrderStep.do",
    data: params,
    method: "post"
  });
};

// 支付接口
export const wxPayBefore = params => {
  return axios.request({
    url: "/carStation/api/order/wxPayBefore.do",
    data: params,
    method: "post"
  });
};

// 发送短信验证码
export const sendVerifyCode = params => {
  return axios.request({
    url: "/carStation/api/users/sendVerifyCode.do",
    data: params,
    method: "post"
  });
};